<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>爱邮资料库</title>
    <link href="/public/css/main.css" rel="stylesheet" type="text/css">
    <link href="/public/fontAwesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <script src="/public/js/jquery-1.12.4.min.js"></script>
    <script src="/public/js/index.js"></script>
</head>
<body>
    <header>
        <div class="backimg"><img src="/public/images/background.png"></div>
        <div class="logo"><span></span><img src="/public/images/icon.png"></div>
    </header>
    <nav>
        <div class="menu">
            <a href="/" class="focus">首页</a>
            <a href="/" class="">后台</a>
            <a href="/" class="">前端</a>
            <a href="/" class="">数据库</a>
            <a href="/" class="">测试</a>
            <a href="/" class="">运维</a>
        </div>
    </nav>
    <main class="clear">
        <div class="mainLeft">

            <div class="listBox">
                <h1>{{content.title}}</h1>
                <p class="colDefault">
                    作者：<span class="colInfo">{{content.user.username}}</span> -
                    时间：<span class="colInfo">{{content.addTime|date('Y年m月d日 H:i:s', -8*60)}}</span> -
                    阅读：<span class="colInfo">{{content.views}}</span> -
                    评论：<span class="colInfo">{{content.comments.length}}</span>
                </p>
                <dfn><p>{{content.description}}</p></dfn>
                <div class="function"><a href="/view?contentid={{content.id}}">阅读全文</a></div>
            </div>

        </div>
        <div class="mainRight">
            {% if userInfo._id %}
            <div class="rightBox" id="userInfo">
                <div class="title"><span>用户信息</span></div>
                <p><span class="colDark" id="username">{{userInfo.username}}</span></p>
                {% if userInfo.isAdmin %}
                    <p>
                        <span class="colDark">您好，管理员</span>
                        <span><a href="/admin">进入管理</a></span>
                    </p>
                {% else %}
                    <p><span class="colDark">您好，欢迎使用爱邮资料库</span></p>
                {% endif %}
                <p><span class="colDark"><a href="javascript:javascript:void(0);" id="logout">退出</a></span></p>
            </div>
            {% else %}
            <div class="rightBox" id="loginBox">
                <div class="title"><span>登录</span></div>
                <div class="line"><span class="colDark">用户名：</span><input name="username" type="text" /><em></em></div>
                <div class="line"><span class="colDark">密码：</span><input name="password" type="password" /><em></em></div>
                <div class="line"><span class="colDark"></span><button>登 录</button></div>
                <p class="textRight">还没注册？<a href="javascript:javascript:void(0);" class="colMint">马上注册</a>　</p>
                <p class="colWarning textCenter"></p>
            </div>
            <div class="rightBox" id="registerBox" style="display: none;">
                <div class="title"><span>注册</span></div>
                <div class="line"><span class="colDark">用户名：</span><input name="username" type="text" /></div>
                <div class="line"><span class="colDark">密码：</span><input name="password" type="password" /></div>
                <div class="line"><span class="colDark">确认：</span><input name="repassword" type="password" /></div>
                <div class="line"><span class="colDark"></span><button>注 册</button></div>
                <p class="textRight">已有账号？<a href="javascript:javascript:void(0);" class="colMint">马上登录</a></p>
                <p class="colWarning textCenter"></p>
            </div>
            {% endif %}

            <div class="rightBox">
                <div class="title"><span>旗下产品</span></div>
                <p><a href="http://www.520post.com" target="_blank" class="colDanger">跨境电商综合平台</a></p>
            </div>
        </div>
    </main>
    <div class="copyright textCenter">版权声明©2015-2016 深圳市爱邮网络科技有限公司 经营许可证 保留所有权利</div>
</body>
</html>